{% extends "layout" %}

{% block local %}<div id="local">
	{% if tests %}
	{% if tests.getstatus %}<div class="tests_ok">
	<h3 class="tests_pass">Tests unitaires</h3>
	<p>{{ tests.getpasscount }} tests réussis. <!--<a href="kit/{{ id }}/tests">voir le détail</a>.--></p>
	</div>
	{% else %}<div class="tests_ko">
	<h3 class="tests_fails">Tests unitaires</h3>
	<p>{{ tests.getfailcount }} tests en echecs. <a href="kit/{{ id }}/tests">voir le détail</a>.</p>
	</div>{% endif %}{% endif %}
</div>{% endblock %}

{% block main %}
	<h2>Kit {{ kit.getid }} {{ cfg.kit.version }} </h2>
	<p>{{ cfg.kit.desc }}</p>

	{% if cfg.kit.link %}<p><a href="{{ cfg.kit.link }}">web site</a></p>{% endif %}

	{% if cfg.kit.phpversion %}
		<p>PHP versions supported : {{ cfg.kit.phpversion }}</p>
	{% endif %}

	{% if cfg.load_kits %}<div class="dependencies">
	<h3>Required Kits</h3>
	<ul class="req-kits">{% for req in cfg.load_kits %}
		<li><a href="kit/{{ req }}">{{ req}}</a></li>{% endfor %}
	</ul>
	</div>{% endif %}

	{% if kit.listsubkits %}
	{% comment %}<table class="kits" summary="subkits">
		<caption>Subkits for <a href="kit/{{ kit.getid }}">{{ kit.getid }}</a></caption>
		<tr class="headers">
			<th>Id</th>
			<th>Description</th>
			<th class="tests"><span>Has unit tests ?</span></th>
			<th class="doc"><span>Has documentation ?</span></th>
			<th class="subkits"><span>Has subkits ?</span></th>
		</tr>{% for cfg in subkits %}
		<tr class="{% cycle odd,even %}">
			<td><a href="kit/{{ forloop.key }}">{{ forloop.key }}</a></td>
			<td>{{ cfg.kit.desc }}</td>

			{% if cfg.tools.tests %}
				<td class="icon has_tests"><span>yes</span></td>
			{% else %}
				<td class="icon has_no_tests"><span>no</span></td>
			{% endif %}

			<td></td>

			{% if cfg.subkits %}
				<td class="has_subkits"><span>{{ cfg.subkits|count }}</span></td>
			{% else %}
				<td class="has_no_subkits"><span>0</span></td>
			{% endif %}

			{% if cfg.kit.link %}
				<td class="link"><a href="{{ cfg.kit.link }}">web</a></td>
			{% else %}
				<td class="link"></td>
			{% endif %}

		</tr>{% endfor %}
	</table>{% endcomment %}

	<div class="subkits">
	<h3>Included SubKits</h3>
	<ul>{% for subkit in subkits %}
		<li class="{% ifincollection subkit cfg.load_subkits %}loaded{% endifincollection %}">
			<a href="kit/{{ kit.getid }}.{{ subkit }}">{{ subkit }}</a>

		</li>{% endfor %}
	</ul>
	</div>{% endif %}
	{% endif %}

	{% if cfg.load_files %}<div class="files">
	<h3>Included library files</h3>
	<dl>{% for file in cfg.load_files %}
		<dt>{{ file }}</dt>{% endfor %}
	</dl>
	</div>{% endif %}
	<p>view kit.index</p>
{% endblock %}
